package com.happy.admin.controller;



import com.happy.film.entity.dto.TagDto;
import com.happy.film.entity.dto.TagVo;
import com.happy.film.entity.vo.Result;
import com.happy.film.service.ITagsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * \* User: wei.zhang
 * \* Date: 2020/3/18 18:20
 * \* Description:
 *
 * @author wei.zhang
 * \
 */
@RestController
@RequestMapping("/api/tag")
public class TagsController {


    @Autowired
    private ITagsService tagsService;

    @ApiOperation("查询tag的列表 分页必须 如果没有，则默认最多20")
    @PostMapping("/list")
    public Result list(@RequestBody TagDto tagDto){
        List<TagVo> tagVos = tagsService.searchTags(tagDto);
        return Result.data(tagVos);
    }



}
